package com.yanqu.road.entity.union;

import com.alibaba.fastjson.annotation.JSONField;
import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.activity.unionwar.cross.UnionWarPatronsData;
import com.yanqu.road.entity.activity.unionwar.cross.UnionWarUserData;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;

public class UnionWarDetail extends DataObject {
    private int mark;
    private String unionUid;
    private long unionExp;
    private String unionName;
    private int unionFlag;
    private String masterNickName;
    private Map<Long, UnionWarUserData> userUnionWarInfoMap = new ConcurrentHashMap<>();
    private Map<Long, UnionWarUserRank> userDonateMap = new ConcurrentHashMap<>();
    private Map<Long, UnionWarUserRank> userDamageMap = new ConcurrentHashMap<>();

    @JSONField(serialize = false)
    private List<UnionWarPatronsData> patronsList = new ArrayList<>();

    @JSONField(serialize = false)
    private long lastUpdateTime;

    @JSONField(serialize = false)
    private long checkTime;

    @JSONField(serialize = false)
    private BigInteger totalDonateSilver = BigInteger.ZERO;

    @JSONField(serialize = false)
    private long unionTotalAbility;

    @JSONField(serialize = false)
    private long enemyServerId = 0;

    @JSONField(serialize = false)
    private String enemyUnionUid = "";

    @JSONField(serialize = false)
    private long serverId = 0;

    @JSONField(serialize = false)
    private long score = 0;

    @JSONField(serialize = false)
    private int win;

    @JSONField(serialize = false)
    private int winTimes;

    public UnionWarDetail() {

    }

    public UnionWarDetail(String unionUid) {
        this.unionUid = unionUid;
    }

    public int getMark() {
        return mark;
    }

    public void setMark(int mark) {
        this.mark = mark;
    }

    public int getWinTimes() {
        return winTimes;
    }

    public void setWinTimes(int winTimes) {
        this.winTimes = winTimes;
    }

    public long getUnionExp() {
        return unionExp;
    }

    public void setUnionExp(long unionExp) {
        this.unionExp = unionExp;
    }

    public int getUnionFlag() {
        return unionFlag;
    }

    public void setUnionFlag(int unionFlag) {
        this.unionFlag = unionFlag;
    }

    public List<UnionWarPatronsData> getPatronsList() {
        return patronsList;
    }

    public void setPatronsList(List<UnionWarPatronsData> patronsList) {
        this.patronsList = patronsList;
    }

    public int getWin() {
        return win;
    }

    public void setWin(int win) {
        if (this.win != win) {
            this.win = win;
            setUpdateOption();
        }
    }

    public long getUnionTotalAbility() {
        return unionTotalAbility;
    }

    public void setUnionTotalAbility(long unionTotalAbility) {
        if (this.unionTotalAbility != unionTotalAbility) {
            this.unionTotalAbility = unionTotalAbility;
            setUpdateOption();
        }
    }

    public long getScore() {
        return score;
    }

    public void setScore(long score) {
        if (score != this.score) {
            this.score = score;
            setUpdateOption();
        }
    }

    public String getUnionName() {
        return unionName;
    }

    public void setUnionName(String unionName) {
        this.unionName = unionName;
    }

    public String getMasterNickName() {
        return masterNickName;
    }

    public void setMasterNickName(String masterNickName) {
        this.masterNickName = masterNickName;
    }

    public long getServerId() {
        return serverId;
    }

    public void setServerId(long serverId) {
        if (this.serverId != serverId) {
            this.serverId = serverId;
            setUpdateOption();
        }
    }

    public long getEnemyServerId() {
        return enemyServerId;
    }

    public void setEnemyServerId(long enemyServerId) {
        if (this.enemyServerId != enemyServerId) {
            this.enemyServerId = enemyServerId;
            setUpdateOption();
        }
    }

    public String getEnemyUnionUid() {
        return enemyUnionUid;
    }

    public void setEnemyUnionUid(String enemyUnionUid) {
        if (!Objects.equals(this.enemyUnionUid, enemyUnionUid)) {
            this.enemyUnionUid = enemyUnionUid;
            setUpdateOption();
        }
    }

    public BigInteger getTotalDonateSilver() {
        return totalDonateSilver;
    }

    public void setTotalDonateSilver(BigInteger totalDonateSilver) {
        this.totalDonateSilver = totalDonateSilver;
    }

    public long getCheckTime() {
        return checkTime;
    }

    public void setCheckTime(long checkTime) {
        this.checkTime = checkTime;
    }

    public Map<Long, UnionWarUserData> getUserUnionWarInfoMap() {
        return userUnionWarInfoMap;
    }

    public void setUserUnionWarInfoMap(Map<Long, UnionWarUserData> userUnionWarInfoMap) {
        this.userUnionWarInfoMap = userUnionWarInfoMap;
    }

    public long getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(long lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

    public String getUnionUid() {
        return unionUid;
    }

    public void setUnionUid(String unionUid) {
        this.unionUid = unionUid;
    }

    public Map<Long, UnionWarUserRank> getUserDonateMap() {
        return userDonateMap;
    }

    public void setUserDonateMap(Map<Long, UnionWarUserRank> userDonateMap) {
        this.userDonateMap = userDonateMap;
    }

    public Map<Long, UnionWarUserRank> getUserDamageMap() {
        return userDamageMap;
    }

    public void setUserDamageMap(Map<Long, UnionWarUserRank> userDamageMap) {
        this.userDamageMap = userDamageMap;
    }
}
